define(function(require, exports, module) {

  var Backbone = require('backbone');
  var $ = require('jquery');
  var _ = require('underscore');
  var jsonview = require('jsonview');

  var $ = require('js/util/deparam')

  function getOption() {
    var style = {
      axisLabel: 3
    }

    var option = {
      len: 2,
      formatter: function (value) {
        return value.toFixed(style.axisLabel);
      }
    }

    return option;
  }

  function main() {
    var $app = $('<div id="app">');
    $('#main').html($app);

    p($.deparam("type=3&clickContent%5Bcarousel%5D%5B%5D=424c7707b9a04732dfd2bc1b6309b66e_0&clickContent%5Bcarousel%5D%5B%5D=424c7707b9a04732dfd2bc1b6309b66e_0&clickContent%5Bcarousels%5D%5B0%5D%5Bname%5D=%E4%BA%A4%E6%98%93%E9%A2%9D&clickContent%5Bcarousels%5D%5B0%5D%5Bvalue%5D%5B%5D=424c7707b9a04732dfd2bc1b6309b66e_0&clickContent%5Bcarousels%5D%5B0%5D%5Bvalue%5D%5B%5D=424c7707b9a04732dfd2bc1b6309b66e_0&clickContent%5Bcarousels%5D%5B1%5D%5Bname%5D=%E4%BA%A4%E6%98%93%E9%87%8F&clickContent%5Bcarousels%5D%5B1%5D%5Bvalue%5D%5B%5D=424c7707b9a04732dfd2bc1b6309b66e_0&clickContent%5Bcarousels%5D%5B1%5D%5Bvalue%5D%5B%5D=424c7707b9a04732dfd2bc1b6309b66e_0&clickContent%5Bcarousels%5D%5B2%5D%5Bname%5D=%E5%BC%80%E6%88%B7%E6%95%B0&clickContent%5Bcarousels%5D%5B2%5D%5Bvalue%5D%5B%5D=424c7707b9a04732dfd2bc1b6309b66e_0&clickContent%5Bcarousels%5D%5B2%5D%5Bvalue%5D%5B%5D=424c7707b9a04732dfd2bc1b6309b66e_0&clickContent%5Bcarousels%5D%5B3%5D%5Bname%5D=%E4%B8%9A%E5%8A%A1%E9%87%8F&clickContent%5Bcarousels%5D%5B3%5D%5Bvalue%5D%5B%5D=424c7707b9a04732dfd2bc1b6309b66e_0&clickContent%5Bcarousels%5D%5B3%5D%5Bvalue%5D%5B%5D=424c7707b9a04732dfd2bc1b6309b66e_0"))
    
    // var option = getOption()

    // var _option = deepCopy(option);

    // console.log(_option)
    // console.log(_option.formatter(2.3454474))

    // $.ajax('http://xiongbin.cf/assets/svg/phone.svg', {
    //   dataType: 'text'
    // }).success(function(data) {
    //   alert(data)
    // })
    
    // alert(typeof (Math.max(16, '18')))
  }

  function function2string(k, v) {
    if (typeof v === 'function') {
      return v + '';
    }
    return v
  }

  function string2function(k, v) {
    if (typeof v === 'string' && v.indexOf('function') > -1) {
      return eval('(function(){return ' + v + ' })()')
    }
    return v
  }

  /**
   * 序列化json对象或js对象
   * @param  {[type]} obj [description]
   * @return {[type]}     [description]
   */
  function serialize(obj) {
    return JSON.stringify(obj, function2string)
  }

  /**
   * 反序列化json字符串
   * @param  {[type]} obj [description]
   * @return {[type]}     [description]
   */
  function unSerialize(obj) {
    return JSON.parse(obj, string2function)
  }

  /**
   * 深拷贝，支持 值为 function 类型
   * @param  {[type]} obj [description]
   * @return {[type]}     [description]
   */
  function deepCopy(obj) {
    return unSerialize(serialize(obj))
  }

  return main;
})
